#ifndef __UDP_H__
#define __UDP_H__

#include <sys/time.h>
#include <netinet/in.h>
#include <mh/common.h>

#define INET_MAX_PACKET (1024)

struct _MH_UDP{
    int soc_fd;
    struct sockaddr_in rem_addr;
    struct sockaddr_in loc_addr;
};

typedef struct _MH_UDP MH_UDP;

int udp_init(MH_UDP *pudp);
int udp_close(MH_UDP *pudp);
int udp_send_data(MH_UDP *pudp, char *buf, unsigned int size);
int udp_recv_data(MH_UDP *pudp, char *buf, unsigned int size);

#endif

